inspector: Properly update flashing hilight
authorBenjamin Otte <otte@redhat.com>
Mon, 1 Dec 2014 14:38:26 +0000 (15:38 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 1 Dec 2014 14:43:43 +0000 (15:43 +0100)
Previously, the inspector would not change the hilight while the
previous hilight was still flashing.
This is inconvenient while arrowing through the object selection
treeview though where you want the currently selected row to hilight
when arrowing quickly.

gtk/inspector/inspect-button.c

index a006bc9f62c25b4e81a6635f62059fc686d6b665..f469a6273d62c9b888a98e668250be24ce2feccc 100644 (file)
@@ -199,6 +199,8 @@ static void
 start_flash (GtkInspectorWindow *iw,
              GtkWidget          *widget)
 {
+  clear_flash (iw);
+
   iw->flash_count = 1;
   iw->flash_widget = widget;
   g_signal_connect_after (widget, "draw", G_CALLBACK (draw_flash), iw);
@@ -447,12 +449,15 @@ void
 gtk_inspector_flash_widget (GtkInspectorWindow *iw,
                             GtkWidget          *widget)
 {
-  if (iw->flash_cnx != 0)
-    return;
-
   if (!gtk_widget_get_visible (widget) || !gtk_widget_get_mapped (widget))
     return;
 
+  if (iw->flash_cnx != 0)
+    {
+      g_source_remove (iw->flash_cnx);
+      iw->flash_cnx = 0;
+    }
+
   start_flash (iw, widget);
   iw->flash_cnx = g_timeout_add (150, (GSourceFunc) on_flash_timeout, iw);
 }